home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / maestro / source / dtr / pause.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-15  |  3.7 KB  |  107 lines

  1. /*
  2.  * Copyright (c) 1990, 1991 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, and distribute this software and 
  5.  * its documentation for any purpose is hereby granted without fee, provided
  6.  * that (i) the above copyright notices and this permission notice appear in
  7.  * all copies of the software and related documentation, and (ii) the name
  8.  * Stanford may not be used in any advertising or publicity relating to
  9.  * the software without the specific, prior written permission of
  10.  * Stanford.
  11.  * 
  12.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  13.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  14.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  15.  *
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
  17.  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
  18.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT
  19.  * ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY,
  20.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  21.  * SOFTWARE.
  22.  */
  23.  
  24. /* $Header: /Source/Media/collab/DTR/RCS/pause.c,v 1.0 92/01/07 14:23:09 drapeau Exp Locker: derek $ */
  25. /* $Log:    pause.c,v $
  26.  * Revision 1.0  92/01/07  14:23:09  drapeau
  27.  * Made a number of cosmetic changes to make code easier to read and
  28.  * to conform to programming specifications.
  29.  * 
  30.  * Revision 0.16  91/09/18  22:47:33  derek
  31.  * The following things are done:
  32.  * 1.    The Makefile is changed corresponding to the changes in collab/.
  33.  * 2.    Copyright messages included.
  34.  * 3.    Some minor bugs fixed.
  35.  * 
  36.  * Revision 0.15  91/08/16  18:10:46  derek
  37.  * 
  38.  * The following things are done:
  39.  * 1.    I have fixed an openpanel bug in my code in which I 
  40.  *     made the app return the wrong values to OpenHandler and
  41.  *     the SaveHandler.
  42.  * 2.    The flashing color of the play button has been changed from
  43.  *     Red to Green.
  44.  * 3.    Fixed a quantization bug: Buffer.play.end, when converted
  45.  *     from endingTimeInSec, should not exceed Buffer_hdr_data_size - 1.
  46.  * 
  47.  * Revision 0.14  91/08/13  20:38:35  derek
  48.  * The buttons (play, pause, record) will now flash after they are pressed.
  49.  * This only applies to times when audio files (not edit-lists) are 
  50.  * played.
  51.  * 
  52.  * Revision 0.13  91/08/07  16:24:34  derek
  53.  * The Edit list part of DTR is done.  OpenPanel is also incorporated.
  54.  * 
  55.  * Revision 0.12  91/06/26  15:55:20  derek
  56.  * I have reformatted the code to conform coding specs.
  57.  * 
  58.  * Revision 0.11  91/06/05  15:00:01  derek
  59.  * checking in after porting the code to collab
  60.  * 
  61.  * Revision 0.10  1991/04/25  01:49:16  derek
  62.  * This version is checked in on 4/24/91
  63.  * */
  64. static char rcsid[] = "$Header: /Source/Media/collab/DTR/RCS/pause.c,v 1.0 92/01/07 14:23:09 drapeau Exp Locker: derek $";
  65.  
  66. #include "dtr.h"
  67. #include "dtr_ui.h"
  68.  
  69. void
  70.   Pause()
  71. {
  72.   extern   dtr_mainWindow_objects               *dtr_mainWindow;
  73.  
  74.   EVENT("Pause");
  75.   if (!ActiveFlag)
  76.     return;
  77.   if (ActiveFlag & PLAY)
  78.   {
  79.     if (Buffer.paused)
  80.     {
  81.       (void) audio_resume_play(Audioctl_fd);
  82.       xv_set(dtr_mainWindow->pauseButton, PANEL_ITEM_COLOR, BlackColorIndex, NULL);
  83.     }
  84.     else
  85.     {
  86.       (void) audio_pause_play(Audioctl_fd);
  87.       xv_set(dtr_mainWindow->pauseButton, PANEL_ITEM_COLOR, GreenColorIndex, NULL);
  88.       xv_set(dtr_mainWindow->playButton, PANEL_ITEM_COLOR, GreenColorIndex, NULL);
  89.     }
  90.   }
  91.   if (ActiveFlag & RECORD)
  92.   {
  93.     if (Buffer.paused)
  94.     {
  95.       (void) audio_resume_record(Audioctl_fd);
  96.       xv_set(dtr_mainWindow->pauseButton, PANEL_ITEM_COLOR, BlackColorIndex, NULL);
  97.     }
  98.     else
  99.     {
  100.       (void) audio_pause_record(Audioctl_fd);
  101.       xv_set(dtr_mainWindow->pauseButton, PANEL_ITEM_COLOR, RedColorIndex, NULL);
  102.       xv_set(dtr_mainWindow->recordButton, PANEL_ITEM_COLOR, RedColorIndex, NULL);
  103.     }
  104.   }
  105. }    
  106.  
  107.